/*
 * sort_degree.cpp
 *
 *sort the nodes of the actual node-set with increasing degree
 *
 *  Created on: 5 Dec 2013
 *      Author: to
 */
#include <iostream>

void sort_degree(int * level_node_set,int * Pointer_nodes, int level_begin,int level_end)

{

int i,j;
int ibuffer;
for (i=level_begin; i< level_end; i++)
{
	for (j=i+1; j< level_end;j++)
	{
		//Pointer_nodes[level_node_set[i]+1]-Pointer_nodes[level_node_set[i]] gives the degree of node i

		if ((Pointer_nodes[level_node_set[i]+1]-Pointer_nodes[level_node_set[i]]) > (Pointer_nodes[level_node_set[j]+1]-Pointer_nodes[level_node_set[j]]))
		{
			ibuffer= level_node_set[i];
			level_node_set[i]= level_node_set[j];
			level_node_set[j]=ibuffer;
		}

	}

}

}
